define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'order.recharge/index',
        add_url: 'order.recharge/add',
        edit_url: 'order.recharge/edit',
        delete_url: 'order.recharge/delete',
        export_url: 'order.recharge/export',
        modify_url: 'order.recharge/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar:['refresh'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID'},
                    {field: 'user.user_nickname', title: '下单用户',search:false},
                    {field: 'user.mobile', title: '手机号',search:false},
                    // {field: 'charge_rule_id', title: '充值规则'},
                    {field: 'order_sn', title: '订单编号'},
                    // {field: 'total_money', title: '金额',search:false},
                    {field: 'charge_money', title: '充值金额',search:false},
                    {field: 'pay_status', search: 'select', selectList: ea.getDataBrage('select_list_pay_status'), title: '支付状态'},
                    {field: 'pay_time', title: '支付时间',search:false},
                    {field: 'create_time', title: '创建时间',search:false},
                    
                    // {width: 250, title: '操作', templet: ea.table.tool , fixed:'right'},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});